package com.gopay.common.domain.fund;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author baiyunpeng
 * @2016年7月14日 下午3:36:05  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "FUND_GOPAY_GEN_ORDER_TRANS_DTL")
public class FundGopayGenOrderTransDtl extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private int transDtlSq;
    private String merId;
    private String merOrderId;
    private String merTxnCd;
    private Date merTxnTm;
    private Date gopayTxnTm;
    private Date gopayServerTime;
    private String gatewayChannel;
    private BigDecimal totalOrderAmt;
    private String curType;
    private String merNotifyStat;
    private String legalOrderRepaet;
    private String gatewayVersion;
    private String charset;
    private String signType;
    private String rspCode;
    private String backgroundMerUrl;
    private String merRemark1;
    private String merRemark2;
    private String tranIp;
    private String dataSource;
    private String source;
    private String memo;
    private Date createdTs;
    private Date lastUpdTs;
    private Integer version;

    private String agentSignNo;

    private String fundNo;

    private String tranType;

    private String verifyCode;

    private String cardNo;

    private Date stlmDate;

    private String fundAccoutNo;

    private String realName;

    private String mobile;

    private String certificateType;

    private String certificateNo;

    private String bankCode;

    //解绑卡类型,1绑卡,2解绑
    private String bankNoType;
    //金额
    private Double amt;
    private String fundAgreeNo;//FUND_AGREE_NO

    private String bizType;//业务类型

    //add by songfengli 20160926
    private String remoteIp;

    //add by liuyu, 20171228, 接口文档版本号，2.7版本加入
    private String docVersion;


    @Id
    @SequenceGenerator(name = "PgFundOrderTransDtlSequence", sequenceName = "PG_GEN_ORDER_TRANS_DTL_SEQ",allocationSize=1)
    @GeneratedValue(generator = "PgFundOrderTransDtlSequence", strategy = GenerationType.SEQUENCE)
    @Column(name = "TRANS_DTL_SQ", unique = true, nullable = false, precision = 22, scale = 0)
    public int getTransDtlSq() {
        return transDtlSq;
    }

    public void setTransDtlSq(int transDtlSq) {
        this.transDtlSq = transDtlSq;
    }

    @Basic
    @Column(name = "MER_ID",length = 10)
    public String getMerId() {
        return merId;
    }

    public void setMerId(String merId) {
        this.merId = merId;
    }

    @Basic
    @Column(name = "MER_ORDER_ID")
    public String getMerOrderId() {
        return merOrderId;
    }

    public void setMerOrderId(String merOrderId) {
        this.merOrderId = merOrderId;
    }

    @Basic
    @Column(name = "FUND_AGREE_NO",length = 32)
    public String getFundAgreeNo() {
		return fundAgreeNo;
	}

	public void setFundAgreeNo(String fundAgreeNo) {
		this.fundAgreeNo = fundAgreeNo;
	}

    @Basic
    @Column(name = "MER_TXN_CD",length = 10)
    public String getMerTxnCd() {
        return merTxnCd;
    }

    public void setMerTxnCd(String merTxnCd) {
        this.merTxnCd = merTxnCd;
    }

    @Basic
    @Column(name = "MER_TXN_TM",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getMerTxnTm() {
        return merTxnTm;
    }

    public void setMerTxnTm(Date merTxnTm) {
        this.merTxnTm = merTxnTm;
    }

    @Basic
    @Column(name = "GOPAY_TXN_TM",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getGopayTxnTm() {
        return gopayTxnTm;
    }

    public void setGopayTxnTm(Date gopayTxnTm) {
        this.gopayTxnTm = gopayTxnTm;
    }

    @Basic
    @Column(name = "GOPAY_SERVER_TIME",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getGopayServerTime() {
        return gopayServerTime;
    }

    @Column(name = "AGENT_SIGN_NO",length = 50)
    public String getAgentSignNo() {
        return agentSignNo;
    }

    public void setAgentSignNo(String agentSignNo) {
        this.agentSignNo = agentSignNo;
    }

    @Column(name = "FUND_NO",length = 20)
    public String getFundNo() {
        return fundNo;
    }

    public void setFundNo(String fundNo) {
        this.fundNo = fundNo;
    }

    @Column(name = "TRAN_TYPE",length = 2)
    public String getTranType() {
        return tranType;
    }

    public void setTranType(String tranType) {
        this.tranType = tranType;
    }

    @Basic
    @Column(name = "VERIFY_CODE",length = 6)
    public String getVerifyCode() {
        return verifyCode;
    }

    public void setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
    }

    @Column(name = "CARD_NO",length = 150)
    public String getCardNo() {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  start*/
        this.cardNo = SensitiveInfoUtils.autoReencrypt(this.cardNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.cardNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  end*/
    }

    public void setCardNo(String cardNo) {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  start*/
        this.cardNo = SensitiveInfoUtils.smartEncryptWithCheck(cardNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  end*/
    }

    @Column(name = "STLM_DATE",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getStlmDate() {
        return stlmDate;
    }

    public void setStlmDate(Date stlmDate) {
        this.stlmDate = stlmDate;
    }

    @Column(name = "FUND_ACCOUT_NO",length = 30)
    public String getFundAccoutNo() {
        return fundAccoutNo;
    }

    public void setFundAccoutNo(String fundAccoutNo) {
        this.fundAccoutNo = fundAccoutNo;
    }

    @Column(name = "REAL_NAME",length = 150)
    public String getRealName() {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  start*/
        this.realName = SensitiveInfoUtils.autoReencrypt(this.realName);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.realName);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  end*/
    }

    public void setRealName(String realName) {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  start*/
        this.realName = SensitiveInfoUtils.smartEncryptWithCheck(realName);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  end*/
    }

    @Column(name = "MOBILE",length = 11)
    public String getMobile() {
        //return mobile;
        /**
         * modified by zyt 2017-4-10 自动重新加密并解密返回
         */
        this.mobile = SensitiveInfoUtils.autoReencrypt(this.mobile);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.mobile);
    }

    public void setMobile(String mobile) {
        //this.mobile = mobile;
        /**
         * modified by zyt 2017-4-10 写操作的时候做加密
         */
        this.mobile = SensitiveInfoUtils.smartEncryptWithCheck(mobile);
    }

    @Column(name = "CERTIFICATE_TYPE",length = 30)
    public String getCertificateType() {
        return certificateType;
    }

    public void setCertificateType(String certificateType) {
        this.certificateType = certificateType;
    }

    @Column(name = "CERTIFICATE_NO",length = 150)
    public String getCertificateNo() {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  start*/
        this.certificateNo = SensitiveInfoUtils.autoReencrypt(this.certificateNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.certificateNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:17  end*/
    }

    public void setCertificateNo(String certificateNo) {
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  start*/
        this.certificateNo = SensitiveInfoUtils.smartEncryptWithCheck(certificateNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/27 15:18  end*/
    }

    @Column(name = "BANK_CODE",length = 20)
    public String getBankCode() {
        return bankCode;
    }

    public void setBankCode(String bankCode) {
        this.bankCode = bankCode;
    }

    public void setGopayServerTime(Date gopayServerTime) {
        this.gopayServerTime = gopayServerTime;
    }

    @Basic
    @Column(name = "GATEWAY_CHANNEL",length = 2)
    public String getGatewayChannel() {
        return gatewayChannel;
    }

    public void setGatewayChannel(String gatewayChannel) {
        this.gatewayChannel = gatewayChannel;
    }

    @Basic
    @Column(name = "TOTAL_ORDER_AMT",length = 20)
    public BigDecimal getTotalOrderAmt() {
        return totalOrderAmt;
    }

    public void setTotalOrderAmt(BigDecimal totalOrderAmt) {
        this.totalOrderAmt = totalOrderAmt;
    }

    @Basic
    @Column(name = "CUR_TYPE",length = 3)
    public String getCurType() {
        return curType;
    }

    public void setCurType(String curType) {
        this.curType = curType;
    }

    @Basic
    @Column(name = "MER_NOTIFY_STAT",length = 1)
    public String getMerNotifyStat() {
        return merNotifyStat;
    }

    public void setMerNotifyStat(String merNotifyStat) {
        this.merNotifyStat = merNotifyStat;
    }

    @Basic
    @Column(name = "LEGAL_ORDER_REPAET",length = 1)
    public String getLegalOrderRepaet() {
        return legalOrderRepaet;
    }

    public void setLegalOrderRepaet(String legalOrderRepaet) {
        this.legalOrderRepaet = legalOrderRepaet;
    }

    @Basic
    @Column(name = "GATEWAY_VERSION",length = 5)
    public String getGatewayVersion() {
        return gatewayVersion;
    }

    public void setGatewayVersion(String gatewayVersion) {
        this.gatewayVersion = gatewayVersion;
    }

    @Basic
    @Column(name = "CHARSET",length = 1)
    public String getCharset() {
        return charset;
    }

    public void setCharset(String charset) {
        this.charset = charset;
    }

    @Basic
    @Column(name = "SIGN_TYPE",length = 1)
    public String getSignType() {
        return signType;
    }

    public void setSignType(String signType) {
        this.signType = signType;
    }

    @Basic
    @Column(name = "RSP_CODE",length = 4)
    public String getRspCode() {
        return rspCode;
    }

    public void setRspCode(String rspCode) {
        this.rspCode = rspCode;
    }

    @Basic
    @Column(name = "BACKGROUND_MER_URL",length = 256)
    public String getBackgroundMerUrl() {
        return backgroundMerUrl;
    }

    public void setBackgroundMerUrl(String backgroundMerUrl) {
        this.backgroundMerUrl = backgroundMerUrl;
    }

    @Basic
    @Column(name = "MER_REMARK1",length = 500)
    public String getMerRemark1() {
        return merRemark1;
    }

    public void setMerRemark1(String merRemark1) {
        this.merRemark1 = merRemark1;
    }

    @Basic
    @Column(name = "MER_REMARK2",length = 500)
    public String getMerRemark2() {
        return merRemark2;
    }

    public void setMerRemark2(String merRemark2) {
        this.merRemark2 = merRemark2;
    }

    @Basic
    @Column(name = "TRAN_IP",length = 19)
    public String getTranIp() {
        return tranIp;
    }

    public void setTranIp(String tranIp) {
        this.tranIp = tranIp;
    }

    @Basic
    @Column(name = "DATA_SOURCE",length = 1)
    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    @Basic
    @Column(name = "SOURCE",length = 1)
    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    @Basic
    @Column(name = "MEMO",length = 256)
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "CREATED_TS",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Basic
    @Column(name = "LAST_UPD_TS",length = 200)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    @Version
    @Column(name = "VERSION", nullable = false, precision = 22, scale = 0)
    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }



    @Basic
    @Column(name = "BANKNO_TYPE",length = 1)
    public String getBankNoType() {
        return bankNoType;
    }

    public void setBankNoType(String bankNoType) {
        this.bankNoType = bankNoType;
    }

    @Basic
    @Column(name = "AMT",length = 20)
    public Double getAmt() {
        return amt;
    }

    public void setAmt(Double amt) {
        this.amt = amt;
    }

    @Basic
    @Column(name = "BIZ_TYPE",length = 2)
    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }

    @Column(name = "REMOTE_IP",length = 40)
    public String getRemoteIp() {
        return remoteIp;
    }

    public void setRemoteIp(String remoteIp) {
        this.remoteIp = remoteIp;
    }

    @Basic
    @Column(name = "DOC_VERSION", length = 4)
    public String getDocVersion() {
        return docVersion;
    }

    public void setDocVersion(String docVersion) {
        this.docVersion = docVersion;
    }
}
